import React from 'react'
import { Select, Input } from "antd";
const { Option } = Select;
const { Search } = Input;
export default function SearchElement({show}) {
    let [type, setType] = React.useState("nickname");
    let [value, setValue] = React.useState("");
    const handleChange =  (type) => {
        setType(type)
     }
     const onSearch=()=>{
       console.log(type, value);
         show({type,value,current:1,pageSize:5});
     }
  return (
    <div>
        <Select
        defaultValue="nickname"
        style={{ width: 120 }}
        onChange={handleChange}
      >
        <Option value="nickname">姓名</Option>
        <Option value="gender">性别</Option>
      </Select>
      <Search style={{ width: "200px" }} onChange={(e) => {
          setValue(e.target.value);
        }} placeholder="请输入" onSearch={onSearch} enterButton />
    </div>
  )
}
